<?php

if (!session_id()) session_start();
include_once( 'config.php' );
include_once( 'weibooauth.php' );

$c = new WeiboClient( WB_AKEY , WB_SKEY , $_SESSION['last_key']['oauth_token'] , $_SESSION['last_key']['oauth_token_secret']  );
$ms  = $c->user_timeline(); // done
$me = $c->verify_credentials();
$my = $c->show_user($me['id']);


?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">	
<link href="weibo.css" rel="stylesheet"  type="text/css"/>
<div id="myinfo">
	<img id='headimg' src="<?=$my['profile_image_url'] ?>"/>
	<ul>
		<li><font id="name"><?php echo $my['name']?></font></li>
		<li><font><?php echo "粉丝:".$my['followers_count']."人"?></font></li>
	</ul>
</div>
<?php if( is_array( $ms ) ): ?>
<?php foreach( $ms as $item ): ?>
<div id="content">
	<p><?=$item['text'];?></p>
	<p  class='tips'><?php //Y/m/d G:i:s A
		echo date("Y/m/d G:i:s",strtotime($item['created_at']));
		$sid = $item['mid'];
		$comment = $c->get_count_info_by_ids($sid);
		echo "<font> 评论(".$comment[0]['comments'].')转发('.$comment[0]['rt'].')</font>';		
//		var_dump($item);
 	?></p>
</div>
<?php endforeach; ?>
<?php endif; ?>